﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MenuConfig.aspx.cs" Inherits="SysManage_MenuConfig" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>菜单配置</title>
    <link rel="stylesheet" href="../Content/redmond/jquery-ui-1.9.2.custom.min.css" type="text/css" />
    <link rel="stylesheet" href="../Content/SysManage.css" type="text/css" />
    <script src="../Scripts/jquery-1.8.3.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-ui-1.9.2.custom.min.js" type="text/javascript"></script>
    <script src="../Scripts/MenuConfig.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="ContentDiv">
            <p>
                <label for="Menu_Title_I" class="lTitle">
                    菜单名称:</label>
                <asp:TextBox ID="Menu_Title_I" runat="server" MaxLength="8" CssClass="text ui-widget-content"></asp:TextBox>
                <asp:Button ID="Query_Menu" runat="server" Text="查询" OnClick="QueryMenu_Click" CssClass="BtnLeft" />
                <input id="AddMenu" type="button" value="新增菜单" class="BtnLeft" />
            </p>
            <asp:GridView ID="MenuList" runat="server" AutoGenerateColumns="False" EmptyDataText="对不起,未找到相关数据！"
                Width="100%" CssClass="ui-widget ui-widget-content" OnRowCancelingEdit="MenuList_RowCancelingEdit"  DataKeyNames="MENU_TITLE"
                OnRowEditing="MenuList_RowEditing" OnRowUpdating="MenuList_RowUpdating" OnRowDataBound="MenuList_RowDataBound">
                <HeaderStyle CssClass="ui-widget-header" />
                <Columns>
                    <asp:BoundField DataField="MENU_TITLE" HeaderText="菜单名称" ReadOnly="true" />
                    <asp:TemplateField HeaderText="所属模块">
                        <ItemTemplate>
                            <asp:Label ID="MENU_TYPE" runat="server" Text='<%# Bind("MENU_TYPE") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList runat="server" ID="MENU_TYPE_I" CssClass="text ui-widget-content ui-corner-all">
                            </asp:DropDownList>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="链接地址">
                        <ItemTemplate>
                            <asp:Label ID="MENU_URL" runat="server" Text='<%# Bind("MENU_URL") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="MENU_URL_I" runat="server" Text='<%# Bind("MENU_URL") %>' MaxLength="64"></asp:TextBox>
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="MENU_URL_I" ID="V_MENU_URL_I"
                                ErrorMessage="*请输入链接地址" Display="Dynamic"></asp:RequiredFieldValidator>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="菜单编号">
                        <ItemTemplate>
                            <asp:Label ID="Menu_Number" runat="server" Text='<%# Bind("Menu_Number") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="Menu_Number_I" runat="server" Text='<%# Bind("Menu_Number") %>' MaxLength="12"></asp:TextBox>
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="Menu_Number_I" ID="V_Menu_Number_I"
                                ErrorMessage="*请输入菜单编号" Display="Dynamic"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator runat="server" ControlToValidate="Menu_Number_I" Display="Dynamic"  
                           ValidationExpression="^[1-9]\d*$" ErrorMessage="*编号必须为正整数" ID="V_Menu_Number_T">
                           </asp:RegularExpressionValidator>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="是否移动页面">
                    <ItemStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:Label ID="IF_MOBILE_L" runat="server" Text='<%# Bind("IF_MOBILE") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList runat="server" ID="IF_MOBILE_I" CssClass="text ui-widget-content ui-corner-all">
                            <asp:ListItem Value="Y">是</asp:ListItem> 
                           <asp:ListItem Value="N">否</asp:ListItem> 
                            </asp:DropDownList>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="是否有效">
                    <ItemStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:Label ID="MENU_STATUS" runat="server" Text='<%# Bind("MENU_STATUS") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList runat="server" ID="MENU_STATUS_I" CssClass="text ui-widget-content ui-corner-all">
                            <asp:ListItem>是</asp:ListItem> 
                           <asp:ListItem>否</asp:ListItem> 
                            </asp:DropDownList>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="CREATE_DATE" HeaderText="何时新增" ReadOnly="true" DataFormatString="{0:yyyy-MM-dd}" />
                    <asp:TemplateField ShowHeader="False">
                        <ItemStyle HorizontalAlign="Right"/>
                        <EditItemTemplate>
                            <asp:Button ID="Modify" runat="server" CausesValidation="true"
                                Text="更新" CommandName="Update" CssClass="ui-button ui-state-default ui-corner-all"/>
                                <asp:Button ID="Cancel" runat="server" CausesValidation="false"
                                Text="取消" CommandName="Cancel" CssClass="ui-button ui-state-default ui-corner-all"/>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Button ID="Edit" runat="server" CausesValidation="false"
                                Text="编辑" CommandName="Edit" CssClass="ui-button ui-state-default ui-corner-all"/>
                            <asp:Button ID="Delete" runat="server" CausesValidation="false"
                                Text="删除" CommandName="Delete" CssClass="ui-button ui-state-default ui-corner-all"
                                 OnClientClick="return confirm('确认删除该菜单吗？');"/>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <div style="text-align: right; padding: 5px;">
                <webdiyer:AspNetPager ID="MenuPager" runat="server" OnPageChanged="MenuPager_PageChanged">
                </webdiyer:AspNetPager>
            </div>
        </div>
        <div id="AddMenuDiv" title="新增菜单" class="DialogDiv">
            <fieldset>
                <p>
                    <label for="MENU_TITLE">
                        菜单名称:</label>
                    <asp:TextBox ID="MENU_TITLE" runat="server" CssClass="text ui-widget-content ui-corner-all"
                        MaxLength="8"></asp:TextBox></p>
                <p>
                    <label for="MENU_TYPE">
                        所属模块:</label>
                    <asp:DropDownList runat="server" ID="MENU_TYPE" CssClass="text ui-widget-content ui-corner-all">
                    </asp:DropDownList></p>                
                <p>
                    <label for="MENU_URL">
                        链接地址:</label>
                    <asp:TextBox ID="MENU_URL" runat="server" CssClass="text ui-widget-content ui-corner-all"
                        MaxLength="64"></asp:TextBox></p>
                <p>
                    <label for="IF_MOBILE">
                        移动页面:</label>
                    <asp:DropDownList runat="server" ID="IF_MOBILE" CssClass="text ui-widget-content ui-corner-all">
                        <asp:ListItem Value="N" Selected="True">否</asp:ListItem>
                        <asp:ListItem Value="Y">是</asp:ListItem>
                    </asp:DropDownList></p>    
                <p>
                    <label for="Menu_Number">
                        菜单编号:</label>
                    <asp:TextBox ID="Menu_Number" runat="server" CssClass="text ui-widget-content ui-corner-all"
                        MaxLength="8"></asp:TextBox></p>
            </fieldset>
            <p class="ActionP">
                <asp:Button ID="BtnCreate" runat="server" Text="创建" OnClick="BtnCreate_Click" />
                <input id="BtnCancel" type="button" value="取消" /></p>
        </div>
    </form>
</body>
</html>
